﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.XtraEditors.Repository;
using DevExpress.XtraEditors.Controls;
using DevExpress.Utils.Win;
using DevExpress.XtraEditors.Popup;
using ProgNetComponentsDx.Options;

namespace Wydatki
{
    public static class WydatkiGlobals
    {
        public static class Events
        {
            public static void DefPrevMonth(RepositoryItemDateEdit edit)
            {
                edit.Popup -= new EventHandler(edit_Popup);
                edit.Popup += new EventHandler(edit_Popup);
            }

            static void edit_Popup(object sender, EventArgs e)
            {
                if (OptionCache.GetOptionBoolValue(Init.InitFormOptionNames.Work_Group.Praca.DefPrevMonth))
                {
                    VistaDateEditCalendar c = ((sender as IPopupControl).PopupWindow as PopupDateEditForm).Calendar as VistaDateEditCalendar;
                    c.DateTime = c.DateTime.AddMonths(-1);
                }
            }
        }

        public static class WybraneFormy
        {
            public const string KPiR = "KPIR";
            public const string VATS = "VATS";
            public const string VATZ = "VATZ";
            public const string Kontrachenci = "KONTRACHENCI";
            public const string Produkty = "PRODUKTY";
            public const string Wydatki = "WYDATKI";
            public const string WydatkiStatystyki = "WYDATKI_STAT";
        }
        public static class WydatkiDefOpenType
        {
            public const string Miesiac = "M";
            public const string Tydzien = "T";
            public const string Ostatnie30Dni = "D";
            public const string Nic = "N";
        }
    }
}
